﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<title>发布新话题 - 群组 - {site.Name}</title>
<script type="text/javascript" src="{site.Dir}_data/SysConfig.js"></script>
<script type="text/javascript" src="{site.Dir}_libs/jquery-min.js"></script>
<script type="text/javascript" src="{site.Dir}_libs/jquery.select.js"></script>
<script type="text/javascript" src="{site.Dir}_libs/jquery.form.js"></script>
<script type="text/javascript" src="{site.Dir}scripts/jumbotcms.js?v4"></script>
<link type="text/css" rel="stylesheet" href="{site.Dir}style/global.css" />
<link type="text/css" rel="stylesheet" href="{site.Dir}_libs/jquery.formvalidator/style.css" />
<script src="{site.Dir}_libs/jquery.formvalidator.js" type="text/javascript"></script>

<script type="text/javascript">
(function(){
	$(document).ready(function(){
		$.ajax({
			type:		"get",
			dataType:	"json",
			data:		"page=1&pagesize=10&time="+(new Date().getTime()),
			url:		site.Dir + "user/mtag/ajax.aspx?ismine=1&oper=ajaxGetList",
			success:	function(data){
				if(data.result == "1"){
					$("#ddlMTagId").empty();
					$("#ddlMTagId").addOption("请选择群组","0");
					for (i=0;i<data.table.length;i++) {
						$("#ddlMTagId").addOption("["+data.table[i].sortname+"] "+data.table[i].title,data.table[i].id);
					}   
					$("#ddlMTagId").change(function() {$("#txtMTagId").val($("#ddlMTagId").val());});
				}
			}
		});
		
		$('#threadaddForm').ajaxForm({
			beforeSubmit: JumbotCms.AjaxFormSubmit,
			success :function(data){
				JumbotCms.Eval(data);
			}
		}); 
		$.formValidator.initConfig({onError:function(msg){}});
		$("#txtMTagId")
			.formValidator({tipid:"tipMTagId",onshow:"",onfocus:"群组选择有误",oncorrect:""})
			.RegexValidator({regexp:"intege1",datatype:"enum",onerror:"群组选择有误"});
		$("#txtTitle")
			.formValidator({tipid:"tipTitle",onshow:"",onfocus:"10-50个字符",oncorrect:""})
			.InputValidator({min:10,max:50,onerror: "10-50个字符,1个汉字为2个字符!"});
		$("#txtContent")
			.formValidator({tipid:"tipContent",onshow:"",onfocus:"50-2000个字符",oncorrect:""})
			.InputValidator({min:50,max:2000,onerror: "至少50-2000个字符!"});
		$("#txtCode")
			.formValidator({tipid:"tipCode",onshow:"",onfocus:"4位验证码",oncorrect:""})
			.InputValidator({min:4,max:4,onerror: "位数不对"});
	});
	//Form验证
	JumbotCms.AjaxFormSubmit=function(item){
		try{
			if(jQuery.formValidator.PageIsValid('1'))
			{
				JumbotCms.Loading.show("正在处理，请稍等...");
				return true;
			}else{
				return false;
			}
		}catch(e){
			return false;
		}
	};
})();
</script>
<script type="text/javascript" src="{site.Dir}user/otherfiles/scripts/ajax.js"></script>
</head>
<body>
<style>
@import url({site.Dir}user/otherfiles/css/style.css);
#ucmenu{width:600px;}
</style>
<iframe frameborder="0" scrolling="no" src="{site.Dir}user/index/index.aspx?do=header" width="100%" height="76" marginwidth="0" marginheight="0" hspace="0" vspace="0" id="ifheader"></iframe>
<!--顶部结束,中框架开始-->
<div id="wrap">
	<div id="main">
		<div id="app_sidebar">
			<ul class="app_list" id="default_userapp">
				<li class="currently"><img src="{site.Dir}user/otherfiles/image/writer_v2/user_home.gif"><a href="{site.Dir}user/index/index.aspx">用户管理中心</a></li>
			</ul>
			<ul class="app_list" id="my_userapp">
				<li class="hr"></li>
				<li><img src="{site.Dir}user/otherfiles/image/writer_v2/contribute.gif"><a href="{site.Dir}user/contribute/index.aspx" target="_blank">我的投稿</a><em></em></li>
				<li><img src="{site.Dir}user/otherfiles/image/app/message.gif"><a href="{site.Dir}user/pmlist/index.aspx">短信</a><em><a href="{site.Dir}user/pmsend/index.aspx">发送</a></em></li>
				<li><img src="{site.Dir}user/otherfiles/image/app/friend.gif"><a href="{site.Dir}user/friendlist/index.aspx">好友</a><em><a href="{site.Dir}user/friendadd/index.aspx">添加</a></em></li>
				<li><img src="{site.Dir}user/otherfiles/image/app/mtag.gif"><a href="{site.Dir}mtag/index/index.aspx">群组</a><em><a href="{site.Dir}user/mtag_thread">话题</a></em></li>
				<li><img src="{site.Dir}user/otherfiles/image/app/favorite.gif"><a href="{site.Dir}user/favorite/index.aspx">收藏夹</a>
			</ul>
		</div>
		<div id="mainarea">
			<h2 class="title"> <img src="{site.Dir}user/otherfiles/image/app/mtag.gif">群组 </h2>
			<div class="tabs_header">
				<ul class="tabs">
					<li class="active"><a href="{site.Dir}mtag/view_threadadd/index.aspx"><span>发表新话题</span></a></li>
					<li><a href="{site.Dir}network/mtag_threadlist/index.aspx?ismine=1"><span>返回我的话题</span></a></li>
				</ul>
			</div>
			<form id="threadaddForm" name="form1" method="post" action="?act=save">
				<input type="hidden" id="txtMTagId" name="txtMTagId" value="0" />
				<table cellspacing="4" cellpadding="4" class="formtable">
					<tr>
						<th width="100">群组名</th>
						<td><select name="ddlMTagId" id="ddlMTagId"></select>
							<a href="{site.Dir}mtag/create/index.aspx">创建新群组</a>
							<div class="ValidatorTip" id="tipMTagId" style="width:200px"></div>
							<br />
							要在您参与的其他群组发表主题，请先进入指定的<a href="{site.Dir}mtag/index/index.aspx">群组</a></td>
					</tr>
					<tr>
						<th width="100"><label for="txtImg">话题</label></th>
						<td><input id="txtTitle" type="text" name="txtTitle" value="" class="t_input" size="80" />
							<div class="ValidatorTip" id="tipTitle" style="width:200px"></div></td>
					</tr>
					<tr>
						<th> <label for="txtContent">内容</label>
						</th>
						<td><textarea id="txtContent" name="txtContent" cols="80" rows="20"></textarea>
							<div class="ValidatorTip" id="tipContent" style="width:200px"></div></td>
					</tr>
					<tr>
						<th> <label for="txtCode">验证</label>
						</th>
						<td><input class="t_input" size="10" type="text" name="txtCode" id="txtCode" maxlength="4" style="ime-mode:disabled;" onpaste="return false" />
							<img onclick="this.src=jcms$$SetUrlRefresh('{site.Dir}plus/getcode3.aspx?h=22');" src="{site.Dir}plus/getcode3.aspx?h=22" align="absmiddle" style="cursor: pointer" alt="不区分大小写,点击换一张" title="不区分大小写,点击换一张" /><img id="imgRead" src="{site.Dir}publicstyle/maintb.gif" align="absmiddle" style="cursor: pointer" alt="收听验证码" title="收听验证码" onclick="PlayCodeVoice('player');" /><span id="player"></span>
							<div class="ValidatorTip" id="tipCode" style="width:200px"></div></td>
					</tr>
					<tr>
						<th>&nbsp;</th>
						<td><input type="submit" name="basesubmit" value="提交保存" class="submit" />
							&nbsp; </td>
					</tr>
				</table>
			</form>
		</div>
		<!--/mainarea-->
		<div id="bottom"></div>
	</div>
</div>
<iframe frameborder="0" scrolling="no" src="{site.Dir}user/index/index.aspx?do=footer" width="100%" height="50" marginwidth="0" marginheight="0" hspace="0" vspace="0" id="iffooter"></iframe>
</body>
</html>
